<?php
require('common_view_functions.php');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><?php echo(htmlspec($blog_info->title)); ?> - Tag：<?php echo(htmlspec($tag_string)); ?></title>

<link rel="shortcut icon" href="/img/favicon.ico" />

<link rel="stylesheet" type="text/css" href="/css/themes/<?php echo($blog_info->skin_name); ?>/styles.css" />
<link rel="stylesheet" type="text/css" href="/css/3rd/jqModal.css" />
<link rel="stylesheet" type="text/css" href="/css/expressions.css" />
<link rel="stylesheet" type="text/css" href="/css/widgets.css" />
<link rel="stylesheet" type="text/css" href="/css/ubb_more.css" />
</head>
<body>
<?php require('ie_warning.php') ?>
<div id="wrapper">
	<!-- header -->
	<?php require('common_header.php'); ?>
	<!-- /header -->
	
	<div id="body">
		<div id="main">
			<div id="entries">
				<h2 class="arch">当前 Tag：<?php echo(htmlspec($tag_string)); ?></h2>
				
				<?php foreach($tag_entries as $entry) { ?>
				
				<div class="entry">
					<h3 class="expr_<?php echo($entry->expression); ?>">
						<?php if($entry->id > 0) { ?>
						<a href="<?php echo('/' . $blogger_uri . '/entry/' . $entry->id); ?>"><?php echo(htmlspec($entry->title)); ?></a>
						<?php } else { ?>
						<?php echo($entry->state == 0 ? '保密网志' : '社区内部网志'); ?>
						<?php } ?>
						<span>@ <?php echo(date_part($entry->post_time)); ?></span>
					</h3>
					
					<?php if($current_user_id > 0) { ?>
						<div class="watch"><a href="javascript:;" rel="w_<?php echo($entry->id); ?>"><img alt="关注此帖" src="/img/star.png" title="关注此帖" /></a></div>
					<?php } ?>
					
					<div class="space"></div>
					
					<div class="content<?php echo(entry_state_indicator($entry->state, TRUE)); ?>">
						<?php echo($entry->content_top . '...'); ?>
					</div>
					
					<div class="tags">
						<?php echo(make_tag_links($entry->tags, $blogger_uri)); ?>
						<div class="z"></div>
					</div>
					
					<div class="info">
						<?php if($is_blog_owner) { ?>
						<input type="button" id="e_<?php echo($entry->id); ?>" class="editEntryButton" value="编辑" />
						<?php } ?>
						发布于 <?php echo($entry->post_time); ?>
						|
						<?php if($entry->id > 0) { ?>
						<a href="<?php echo('/' . $blogger_uri . '/entry/' . $entry->id . '#comments'); ?>">评论：<strong><?php echo($entry->comment_num); ?></strong></a>
						<?php } else { echo('评论：N/A'); } ?>
					</div>
				</div>
				
				<?php } ?>
			</div><!-- /entries -->

		</div><!-- /main -->
		
		<div id="side">
			<dl class="block">
				<dt>tags</dt>
				<dd>
					<ul>
						<?php foreach($tag_list as $t) { ?>
						<li><a href="<?php echo('/' . $blogger_uri . '/tag/' . urlencode($t->tag_text)); ?>"><?php echo(htmlspec($t->tag_text)); ?></a> <?php echo($t->entry_num); ?></li>
						<?php } ?>
					</ul>
				</dd>
			</dl>
			
			<dl class="block">
				<dt>statistics</dt>
				<dd>
					<ul>
						<li>网志数：<?php echo($blog_info->entry_num); ?></li>
						<li>评论数：<?php echo(is_null($blog_info->comment_num) ? '0' : $blog_info->comment_num); ?></li>
					</ul>
				</dd>
			</dl>
		</div><!-- /side -->
		<div class="z"></div>
	
	</div><!-- /body -->
	
	<!-- footer -->
	<?php require('common_footer.php'); ?>
	<!-- /footer -->

</div><!-- /wrapper -->

<!-- Common Widgets -->
<?php require('common_widgets.php'); ?>
<!-- /Common Widgets -->

<!-- JS -->
<script type="text/javascript" src="/js/3rd/jquery.pack.js"></script>
<script type="text/javascript" src="/js/3rd/jqModal.js"></script>
<script type="text/javascript" src="/js/3rd/json2.js"></script>
<script type="text/javascript">
<!--
var g_userSiteRoot = "<?php echo('/' . $blogger_uri); ?>";
// -->
</script>

<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function() {
	registerCommonEvents();
	
	<?php require('common_skin_adapters.php'); ?>
	
});
// -->
</script>
<!-- /JS -->

</body>
</html>